package ro.gateway.aida.tags;

import java.util.Hashtable;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;

import ro.gateway.aida.servlet.EditActivityServlet;



/**
 * <p>Title: Romanian AIDA</p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (comparator) 2003</p>
 * <p>Company: ro-gateway</p>
 * @author Mihai Popoaei, mihai_popoaei@yahoo.com, smike@intellisource.ro
 * @version 1.0-* @version $Id: PrjEditorGetErrorsTag.java,v 1.1 2005/07/20 12:08:58 mihaipostelnicu Exp $
 */
public class PrjEditorGetErrorsTag extends TagSupport
{
      /**
       *
       */
      public int doStartTag() throws JspException
      {
            return ( SKIP_BODY );
      }

      /**
       *
       */
      public int doEndTag() throws JspException
      {
            HttpServletRequest request = ( HttpServletRequest ) pageContext.
                  getRequest();
            Hashtable ed_ctx = ( Hashtable ) request.
                  getAttribute( EditActivityServlet.PNAME_R_CTX );
            if ( ed_ctx == null )
            {
                  return EVAL_PAGE;
            }

            Hashtable errors = ( Hashtable ) ed_ctx.
                  get( EditActivityServlet.PNAME_HERRORS );
            ed_ctx.remove( EditActivityServlet.PNAME_HERRORS );
            if ( errors == null ) errors = new Hashtable();
            pageContext.setAttribute(
                  EditActivityServlet.PNAME_HERRORS, errors );

            return ( EVAL_PAGE );
      }
}
